﻿@model HCQ2_Model.T_DocumentFolder
@{
    ViewBag.Title = "待审核资源";
}
@section headerSection{
    <link href="~/Resources/mainFrame/js/plugins/zTree3/css/demo.css" rel="stylesheet" />
    <link href="~/Resources/mainFrame/js/plugins/zTree3/css/metroStyle/metroStyle.css" rel="stylesheet" />
    <script src="~/Resources/mainFrame/js/plugins/zTree3/js/jquery.ztree.core.min.js"></script>
    <script src="~/Resources/mainFrame/js/plugins/zTree3/js/jquery.ztree.excheck.min.js"></script>
    <script src="~/Resources/mainFrame/js/plugins/zTree3/js/jquery.ztree.exedit.min.js"></script>
    <script src="~/Resources/tools/search_zTree.js"></script>
    <style>
        body {
            font-family: '微软雅黑';
            font-size: 14px;
            color: #676a6c;
        }

        a {
            font-size: 15px;
        }

        .float-unit {
            height: 100%;
            border: 1px solid #E7EAEC;
            border-top-width: 0px;
            border-bottom-width: 0px;
            margin-bottom: 0px;
        }

        .left-sm-3 {
            padding-left: 0px;
        }

        .right-sm-9 {
            padding-right: 0px;
        }

        .ibox-unit {
            overflow-y: auto;
            height: 89%;
            padding: 0px;
        }

        #exampleToolbar div {
            margin-bottom: 0px;
        }

        #exampleToolbar > .form-group {
            float: left;
            margin: 0;
            margin-right: 5px;
            margin-top: 1px;
        }

        .form-group > button {
            margin-top: -2px;
            margin-bottom: 2px;
        }

        #unitTreezTreeData {
            border: 0;
            border-top: 1px solid #E7EAEC;
            background: #FFFFFF;
        }

            #unitTreezTreeData li {
                line-height: 28px;
            }

                #unitTreezTreeData li:hover {
                    background: #F5F5F5;
                }

        #search_condition {
            width: 99%;
        }

        .selectTreezTreeLI {
            background-color: #2DC1C3;
            color: #fff;
        }

        #nodeFormTable label {
            font-weight: bold;
        }

        .fileClass label {
            text-align: right;
        }

        #upFileForm .col-sm-7 {
            margin-bottom: 8px;
        }

        #bootstrap-duallistbox-selected-list_duallistbox_demo1 option, bootstrap-duallistbox-nonselected-list_duallistbox_demo1 option {
            height: 30px;
            line-height: 30px;
            padding-top: 5px;
        }

            #bootstrap-duallistbox-selected-list_duallistbox_demo1 option:hover, bootstrap-duallistbox-nonselected-list_duallistbox_demo1 option:hover {
                background-color: antiquewhite;
            }

        .buttons {
            width: 100%;
        }

            .buttons button {
                width: 50%;
            }
    </style>
}
<div class="wrapper animated fadeInRight autoHeight">
    <!-- Panel Other -->
    <div class="row autoHeight" style="background-color: #fff;">
        <!--选择单位-->
        @*<div id="unitTree" class="col-sm-3" style="width:20%;height:100%;padding:0;border:1px solid #E7EAEC;"></div>*@
        <div class="col-sm-12 col-sm-leftRight" style="padding-left: 3px; margin-top: 2px;">
            <!-- Example Toolbar -->
            <div class="example">
                <div class="btn-group hidden-xs" id="exampleToolbar" role="group">
                    @{
                        List<string> folderList = (List<string>)ViewBag.elementList;
                        if (folderList.Contains("btnSearch"))
                        {
                            <div class="form-group" style="width:180px">
                                <input id="keyword" name="keyword" type="text" class="form-control" placeholder="资源名称/作者/代码">
                            </div>
                            if (string.IsNullOrEmpty(ViewBag.hasUnit))
                            {
                                <div class="form-group" style="margin-top:-3px;width:150px;">
                                    <select id="org_unit" name="org_unit" title="请选择所属单位" data-live-search="true" class="form-control input-sm selectpicker" placeholder="请选择所属单位" style="padding: 5px 10px;">
                                        <option value="" selected>全部</option>
                                        <option value="null">无所属单位</option>
                                    </select>
                                </div>
                            }
                            <div class="form-group">
                                <button id="btnSearch" class="btn btn-primary" type="button"><i class="fa fa-search"></i>&nbsp;查询</button>
                            </div>
                        }
                        if (folderList.Contains("btnApproveFile"))
                        {
                            <div class="form-group">
                                <button id="btnApproveFile" class="btn btn-danger" type="button"><i class="fa fa-trash"></i>&nbsp;审核</button>
                            </div>
                        }
                    }
                </div>
                <table id="exampleTableToolbar" data-mobile-responsive="true" data-radio="true"></table>
            </div>
            <!-- End Example Toolbar -->
        </div>
    </div>
    <!-- End Panel Other -->
</div>
<!-- 审核文档 -->
<div id="appForm" style="width: 460px; overflow: hidden; display: none;">
    <div class="form-group" style="padding-top:20px;">
        <label class="col-sm-3 control-label">审核类别<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
        <div class="col-sm-8">
            <select id="appType" name="appType" title="请选择审核类别"  data-live-search="true" class="form-control input-sm selectcontrol" required="" aria-required="true" placeholder="请选择审核类别" style="padding: 5px 10px;">
                <option value="5" selected>通过</option>
                @*<option value="3">免费共享文档（通过）</option>*@
                <option value="6">不通过</option>
            </select>
        </div>
    </div>
    <div class="form-group" style="padding-top:20px;">
        <label class="col-sm-3 control-label">是否推荐<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
        <div class="col-sm-8">
            <select id="is_recommend" name="is_recommend" title="请选择是否推荐" data-live-search="true" class="form-control input-sm selectcontrol" required="" aria-required="true" placeholder="请选择是否推荐" style="padding: 5px 10px;">
                <option value="0" selected>不推荐</option>
                <option value="1">推荐</option>
            </select>
        </div>
    </div>
</div>
@section footSection{
    <script src="~/Resources/x-editable/js/bootstrap-editable.js"></script>
    <script src="~/Resources/duallistbox/jquery.bootstrap-duallistbox.min.js"></script>
    <script src="~/Resources/myScript/Doc/sourceManager.js"></script>
    <script>
        var userID = "@ViewBag.userID", hasUnit = "@ViewBag.hasUnit";
        var approveManager = {
            initSelect: function () {
                $.ajax({
                    url: ctx + '/SysCommon/GetDictionaryByCode',
                    type: "post",
                    cache: false,
                    async: false,
                    data: { fieldCode: 'SysUserUnit' },
                    dataType: 'json',
                    success: function (data) {
                        if (data.Statu === 1) {
                            layer.msg(data.Msg, { icon: 5 });
                            return false;
                        }
                        var itemStr = "";
                        $.each(data.Data, function (i, item) {
                            itemStr += "<option value='" + item.code_value + "'>" + item.code_name + "</option>";
                        });
                        $('#org_unit').append(itemStr);//查询
                    },
                    error: function () {
                        layer.msg('数据异常~', { icon: 5 });
                    }
                });
                $('.selectpicker').selectpicker({ size: 6 });
                $('.selectpicker').selectpicker('refresh');
            }
        }
        $(function () {
            //所属单位
            if (!hasUnit)
                approveManager.initSelect();
            //初始化页面
            docManager.initPage(userID);
        });
    </script>
}